local skel = fk.CreateSkill {
  name = "emo__chaofeng",
}

skel:addEffect("active", {
  anim_type = "drawcard",
  card_num = 0,
  target_num = 0,
  card_filter = Util.FalseFunc,
  prompt = "#emo__chaofeng",
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    if player.dead then return end
    local judge = {
      who = player,
      reason = skel.name,
      pattern = ".",
    }
    room:judge(judge)
    if player.dead then return end
    if judge.card.color == Card.Red then
      player:drawCards(2, skel.name)
    elseif judge.card.color == Card.Black then
      room:askToGuanxing(player, { cards = room:getNCards(2), skill_name = skel.name })
    end
  end,
})

Fk:loadTranslationTable{
  ["emo__chaofeng"] = "朝凤",
  [":emo__chaofeng"] = "出牌阶段限一次，你可以进行一次判定，若为红色，你摸两张牌，若为黑色，你卜算2。",
  ["#emo__chaofeng"] = "朝凤：你可判定，若为红则摸2张牌，为黑则观星2张",
}


return skel
